Skip to content

Conversation

@andrew-coleman
Copy link
Member

Add support for DdlRel and WriteRel for Hive in Spark

Copy link
Contributor

@bestbeforetoday bestbeforetoday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good. Just a couple of questions from me, and a small suggestion.

)
}
}
case WriteOp.INSERT =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice no isHive check here. Might it be possible to arrive here when isHive is not true?

Comment on lines +31 to +37
val bytes = new PlanProtoConverter()
.toProto(substraitPlan)
.toByteArray

// Read it back
val protoPlan = io.substrait.proto.Plan
.parseFrom(bytes)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's valid but I'm wondering if there is any benefit to doing the work of de/serializing to bytes, rather than just using the protobuf object. Is it exercising anything other than protobuf's ability to de/serialize?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, I put all tests through the full roundtrip lifecycle, including down to the proto bytes to ensure that all the visitors within the proto/rel converters have been implemented.

assertResult(5)(spark.sql("select * from test").count())
}

test("CTAS") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the less expert amongst us, it might be clearer as:

Suggested change
test("CTAS") {
test("Create table as select") {

Add support for DdlRel and WriteRel for Hive in Spark

Signed-off-by: Andrew Coleman <[email protected]>
@bestbeforetoday bestbeforetoday merged commit c20836e into substrait-io:main Sep 30, 2025
12 checks passed
@andrew-coleman andrew-coleman deleted the write_with_hive branch October 1, 2025 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants